/**
 * Copyright 2011 Poltman.Ltd; www.poltman.com. All rights reserved.		
 *
 * This file is part of the dspace-poltman project http://www.poltman.com.
 *
 * This is free software; you can redistribute it and/or modify it under
 * the terms of DuraSpace DSpace license detailed in the LICENSE and NOTICE 
 * files at the root of the source tree and available online at
 * http://www.dspace.org/license/
 * 
 */
package com.poltman.dscentral.db.service.dspace.impl;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.poltman.dscentral.db.entity.dspace.RegistrationdataEntity;
import com.poltman.dscentral.db.repository.dspace.RegistrationdataRepository;
import com.poltman.dscentral.db.service.dspace.RegistrationdataService;

/**
 * 
 * @author Zbigniew Ciok; z.ciok@poltman.com
 * @version $Revision: 1609 $
 *
 */
@Repository
@Service("registrationdataService")
public class RegistrationdataServiceImpl implements RegistrationdataService {
	
	private static Logger log = Logger.getLogger(RegistrationdataServiceImpl.class);
	
	@Autowired
	private RegistrationdataRepository registrationdataRepository;
	
	@Override
	public RegistrationdataEntity findByEmail(String email) throws Exception {
		return registrationdataRepository.findByEmail(email);
	}
	
	@Override
	public RegistrationdataEntity findByToken(String token) throws Exception {
		return registrationdataRepository.findByToken(token);
	}
	
	@Override
	public void deleteByToken(String token) throws Exception {
		registrationdataRepository.deleteByToken(token);
	}
	
	@Override
	public RegistrationdataEntity save(RegistrationdataEntity registrationdataEntity) throws Exception {
		return registrationdataRepository.save(registrationdataEntity);
	}
}
